﻿#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include "contact.h"
void menu()
{
	printf("------------------------------------------\n");
	printf("-----1.add------2.del---------------------\n");
	printf("-----3.serch----4.modfiy------------------\n");
	printf("-----5.show-----6.sort--------------------\n");
	printf("-----0.exit-------------------------------\n");
	printf("------------------------------------------\n");
}
int main()
{
	Contact con;
	InitContact(&con);
	
	int input = 0;
	do
	{
		menu();
		printf("请输入选项:");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			AddContact(&con);
			break;
		case 2:
			DelContact(&con);
			break;
		case 3:
			SerchContact(&con);
			break;
		case 4:
			break;
		case 5:
			ShowContact(&con);
			break;
		case 6:
			break;
		case 0:
			SaveContact(&con);
			Destory_capacity(&con);
			break;
		default:
			printf("输入错误");
		}

	} while (input);

	return 0;
}
